#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include "heapcomm.h"

#define ARRAY_SIZE 10

int main(){
    int i = 0;
    int arr[ARRAY_SIZE+1];
    srand((unsigned)time(NULL));
    for(i=1;i<ARRAY_SIZE+1;i++){
        arr[i] = rand()%1000;
    }

    printf("sort array  [");
    for(i=1;i<ARRAY_SIZE+1;i++){
        printf("%d",arr[i]);
        if(i<ARRAY_SIZE){
            printf(",");
        }
    }
    printf("] \n");
    heap_sort(arr,ARRAY_SIZE);

    printf("sort result [");
    for(i=1;i<ARRAY_SIZE+1;i++){
        printf("%d",arr[i]);
        if(i<ARRAY_SIZE){
            printf(",");
        }
    }
    printf("] \n");

    return 0;
}

